package com.lineage.server.serverpackets;

import com.lineage.server.model.Instance.L1ItemInstance;

public class S_ItemColor extends ServerBasePacket {
  private byte[] _byte;
  
  public S_ItemColor(L1ItemInstance item) {
    this._byte = null;
    if (item == null)
      return; 
    buildPacket(item);
  }
  
  private void buildPacket(L1ItemInstance item) {
    writeC(240);
    writeD(item.getId());
    writeC(item.getBless());
  }
  
  public S_ItemColor(L1ItemInstance item, int id) {
    this._byte = null;
    writeC(240);
    writeD(item.getId());
    writeC(id);
  }
  
  public byte[] getContent() {
    if (this._byte == null)
      this._byte = getBytes(); 
    return this._byte;
  }
  
  public String getType() {
    return getClass().getSimpleName();
  }
}
